package org.vdab.projects.tasks.client.dal;

import java.util.List;

import org.vdab.projects.tasks.shared.EntityManager;
import org.vdab.projects.tasks.shared.entities.ITask;
import org.vdab.projects.tasks.shared.entities.ITaskBook;
import org.vdab.projects.tasks.shared.entities.ITaskList;

public class ClientEntityManager extends EntityManager {

	GWTEntityManager gwtEm = GWTEntityManager.get();
	
	protected static ClientEntityManager instance = new ClientEntityManager();
	
	public static ClientEntityManager get(){
		return instance;
	}
	
	@Override
	public List<ITaskBook> getTaskBooks() throws Exception {
		throw new Exception("getTaskBooks() Not yet implemented");
	}

	@Override
	public void saveTaskBook(ITaskBook taskBook) throws Exception {
		gwtEm.saveTaskBook(taskBook);
	}

	@Override
	public void saveTaskList(ITaskList taskList) throws Exception {
		//throw new Exception("saveTaskList() Not yet implemented");
		gwtEm.saveTaskList(taskList);
	}

	@Override
	public void saveTask(ITask task) throws Exception {
		throw new Exception("saveTask() Not yet implemented");

	}

	@Override
	public ITaskList getTaskListByKey(String key) throws Exception {
		//throw new Exception("getTaskListByKey() Not yet implemented");
		return gwtEm.createTaskList(key); 
	}

	@Override
	public ITaskBook CreateTaskBook() throws Exception {
		throw new Exception("CreateTaskBook() Not yet implemented");
	}

	@Override
	public ITaskList createTaskList(ITaskBook parrent) throws Exception {
		throw new Exception("createTaskList() Not yet implemented");
	}
}
